<template>
    <lemon-common uri="job" ref="commonRef" :search-form-model="searchFormModel" :search-form-item="searchFormItem" :search-condition="searchCondition" :table-item="tableItem" :show-enable="false" :show-unable="false" :dialog-info-form-model="dialogInfoFormModel" :dialog-info-form-item="dialogInfoFormItem" :dialog-edit-form-model="dialogEditFormModel" :dialog-edit-form-item="dialogEditFormItem" :dialog-add-form-model="dialogAddFormModel" :dialog-add-form-item="dialogAddFormItem"></lemon-common>
</template>

<script setup lang="ts">
import { reactive, inject, ref } from "vue";

//获取自定义全局方法
const { rule } = inject<any>("method");

//公共组件ref
const commonRef: any = ref(null);

//搜索的form
const searchFormModel = reactive({
    name: "",
});

//搜索form子项
const searchFormItem = reactive({
    name: { label: "名称", type: "input" },
});

//搜索的条件
const searchCondition = reactive({
    name: "like",
});

//表格每一项
const tableItem = reactive([
    { prop: "name", label: "职位名称", minWidth: "150" },
    { prop: "remark", label: "备注", minWidth: "200" },
    { prop: "createBy", label: "创建人", minWidth: "150" },
    { prop: "createTime", label: "创建时间", minWidth: "200" },
    { prop: "updateBy", label: "修改人", minWidth: "150" },
    { prop: "updateTime", label: "修改时间", minWidth: "200" },
]);

//弹出框详情form
const dialogInfoFormModel = reactive({
    name: "",
    remark: "",
    createBy: null,
    createTime: null,
    updateBy: null,
    updateTime: null,
});

//弹出框详情form子项
const dialogInfoFormItem = reactive({
    name: { label: "职位名称", type: "input", readonly: true },
    remark: { label: "备注", type: "textarea", rows: 3, readonly: true },
    createBy: { label: "创建人", type: "input", readonly: true },
    createTime: { label: "创建时间", type: "datetime", readonly: true },
    updateBy: { label: "修改人", type: "input", readonly: true },
    updateTime: { label: "修改时间", type: "datetime", readonly: true },
});

//弹出框编辑form
const dialogEditFormModel = reactive({
    id: null,
    name: "",
    remark: "",
});

//弹出框编辑form子项
const dialogEditFormItem = reactive({
    name: { label: "职位名称", type: "input", rules: rule.require.input("名称") },
    remark: { label: "备注", type: "textarea", rows: 3 },
});

//弹出框添加form
const dialogAddFormModel = reactive({
    name: "",
    remark: "",
});

//弹出框添加form子项
const dialogAddFormItem = reactive({
    name: { label: "职位名称", type: "input", rules: rule.require.input("名称") },
    remark: { label: "备注", type: "textarea", rows: 3 },
});
</script>

<style scoped lang="less"></style>
